package com.example.springcloud;

import org.springframework.cloud.gateway.handler.predicate.RoutePredicateFactory;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author chensixiang chensixiang1234@gmail.com
 */
@Configuration
public class GateWayConfiguration {


    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder builder) {
        return builder.routes()
                .route("path_route_guonei",
                        r -> r.path("/guonei").uri("http://news.baidu.com/guonei"))
                .build();

    }

}
